package com.xugongzhang.ext;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

/**
 * @author X
 * @date 2022/12/13 0:24
 * 测试监听事件
 */
@Service
@Slf4j
public class UserService {
    
    @EventListener(classes = ApplicationEvent.class)
    public void listen(ApplicationEvent event) {
        log.info("UserService 监听到的事件: {}", event);
    }
}
